package com.ruoyi.system.domain.bo;

import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;

import java.util.Date;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 采购订单主，记录采购订单核心信息业务对象 pms_purchase_orders
 *
 * @author ruoyi
 * @date 2025-07-29
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class PmsPurchaseOrdersBo extends BaseEntity {

    /**
     * 采购订单主键ID
     */
    @NotNull(message = "采购订单主键ID不能为空", groups = { EditGroup.class })
    private Long poId;

    /**
     * 采购订单编号
     */
    @NotBlank(message = "采购订单编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String poCode;

    /**
     * 采购申请单ID
     */
    @NotNull(message = "采购申请单ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long prId;

    /**
     * 采购申请单编号
     */
    @NotBlank(message = "采购申请单编号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String prCode;

    /**
     * 供应商ID，关联wms_suppliers表
     */
    @NotNull(message = "供应商ID", groups = { AddGroup.class, EditGroup.class })
    private Long supplierId;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 订单创建日期（业务日期）
     */
    private Date orderDate;

    /**
     * 预计交货日期
     */
    @NotNull(message = "预计交货日期不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date expectedDeliveryDate;

    /**
     * 付款条款
     */
    private String paymentTerms;

    /**
     * 订单不含税总金额
     */
    @NotNull(message = "订单不含税总金额不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal totalAmount;

    /**
     * 订单总税额
     */
//    @NotNull(message = "订单总税额不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal totalTax;

    /**
     * 订单含税总金额（total_amount + total_tax）
     */
    @NotNull(message = "订单含税总金额（total_amount + total_tax）不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal totalAmountWithTax;

    /**
     * 订单状态: 1-待提交, 2-审批中, 3-已批准, 4-已拒绝, 5-部分收货, 6-已完成, 7-已取消
     */
    @NotBlank(message = "订单状态: 1-待提交, 2-审批中, 3-已批准, 4-已拒绝, 5-部分收货, 6-已完成, 7-已取消不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;

    /**
     * 审批人ID
     */
    private String approverId;

    /**
     * 审批通过时间
     */
    private Date approvedAt;

    /**
     * 创建人ID
     */
    private Long createdBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 最后更新时间
     */
    private Date updatedAt;

    /**
     * 采购人id
     */
    private Long purchaseId;


    /**
     * 收货时间
     */
    private Date receivingTime;
}
